import request from '../utils/request';

export async function bonusList(shopId, branch_no, month) {
  return await request('/bonusList', {
    params: { filter: JSON.stringify({
      month,
      shopId,
      branch_no,
    }),
    },
  });
}

export async function myBonus(shopId, branch_no, sale_id, month) {
  return await request('/myBonus', {
    params: { filter: JSON.stringify({
      month,
      shopId,
      branch_no,
      sale_id,
    }),
    },
  });
}

export async function bonusVipList(shopId, branch_no, sale_id, month, keywords) {
  const params = {
    month,
    shopId,
    branch_no,
    sale_id,
  };
  if (keywords) {
    params.keywords = keywords;
  }

  return await request('/bonusVipList', {
    params: { filter: JSON.stringify(params),
    },
  });
}
